package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.databinding.ActivityFileCompressBinding;

public class FileCompressActivity extends BaseAc<ActivityFileCompressBinding> {

    public static int type;

    @Override
    protected int onCreate() {
        return R.layout.activity_file_compress;
    }

    @Override
    protected void initView() {
        mDataBinding.ivFileCompressBack.setOnClickListener(v -> onBackPressed());

        mDataBinding.ivFileCompress.setOnClickListener(this);
        mDataBinding.ivFileDecompression.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivFileCompress://文件压缩
                FileZipActivity.isZip = true;
                startActivity(FileZipActivity.class);
                break;
            case R.id.ivFileDecompression://文件解压
                FileZipActivity.isZip = false;
                startActivity(FileZipActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {
        if (type == 0) {
            mDataBinding.tvFileCompressTitle.setText(getString(R.string.file_compress));
        } else {
            mDataBinding.tvFileCompressTitle.setText(getString(R.string.file_decompress));
        }
    }
}